package test;

import com.tycredit.demo.CreditApplication;

import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

public class Credit {
    public static void main(String[] args) {
        Map bodyMap = new HashMap();
        bodyMap.put("idNumber","330329198903050011");
        //bodyMap.put("mobileNo","15000000000");
        bodyMap.put("cardNo","6217003180000902693");
        bodyMap.put("personName","商四壁");

        String invoke = CreditApplication.invoke(
                "https://apitest.tycredit.com/credit-front-http/unified/bankThreeVerify.json",
                1, //测试标识testFlag,测试环境传1或5，生产环境传0
                "tianjudihe001",//"机构代码",
                "FE5D7705104C4C0FD2DA0BB6EE8FD2CC",//"发起方交易流水号32位不重复",
                "10151112140001000001542155961605",//"授权号(符合字段要求即可)",
                bodyMap,
                "34c9bc8f41afaabf"//"秘钥接口申请获得的秘钥"
        );
        System.out.print(invoke);
    }

    /**
     * 返回 32 位 UUID
     * @return String UUID
     */
    public static String getRandom() {
        UUID uuid = UUID.randomUUID();
        return uuid.toString().replace("-", "");
    }
}
